@echo off

REM '删除所有凭据'
REM '查看凭证'
REM  cmdkey /list

REM  for /f "tokens=15" %%i in ('ipconfig /all ^| find /i "子网掩码"') do set mask=%%i
REM  for /f "tokens=1" %%i in ('cmdkey /list ^| find /i "Target" ') do set mask=%%i

REM  for /f "tokens=2" %%i in ('cmdkey /list ^| find /i "Target: LegacyGeneric" ') do echo 凭据Target：%%i
REM  for /f "tokens=2" %%i in ('cmdkey /list ^| find /i "Target: LegacyGeneric" ')  do (

REM  for /f "tokens=2" %%i in ('cmdkey /list ^| find /i "Target" ')  do (
for /f "tokens=2" %%i in ('cmdkey /list ^| find /i "Target: LegacyGeneric" ')  do (
	REM '注意：由于设置输出编码utf8格式会导致第一行总是 Active code page: 65001，所以结果会有一个code'
	
	echo 凭据Target：%%i
	REM  '删除凭据'
	cmdkey /delete:%%i
)

 
pause

